package com.yonyou.cyxdms.sysAuth.service.feign.channelclient;

import com.yonyou.cyx.framework.bean.dto.framework.RestResultResponse;
import com.yonyou.cyxdms.basedata.client.domains.vo.RegionVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.ws.rs.POST;
import java.util.Map;

@FeignClient(name = "${feign.dms.repair.name:channel-service}")
public interface CmsIsChannelClient {

    /**
     *  ============================省，市，县=======================================
     */


    /**
     * 根据省名字查询省信息
     * @param regionName 省名
     * @return String
     */
    @GetMapping("/region/getProvinceByNameLike")
    RestResultResponse<Map<String,String>> getProvinceByNameLike(@RequestParam("regionName") String regionName);


    /**
     * 根据城市名字And省id查询信息
     * @param cityName 市名
     * @param provinceId 省id
     * @return String
     */
    @GetMapping("/region/getCityByNameLike")
    RestResultResponse<Map<String,String>> getCityByNameLike(@RequestParam("cityName") String cityName,
                                                             @RequestParam("provinceId") Long provinceId);

    /**
     * 根据城市名字查询省名和code
     * @param cityName
     * @return
     */
    @GetMapping("/region/getProvinceByCityName")
    RestResultResponse<Map<String,String>> getProvinceByCityName(@RequestParam("cityName") String cityName);
    @GetMapping("/region/getRegionById")
    public RestResultResponse<RegionVO> getRegionById(@RequestParam("regionId") Integer regionId);
    //删除区域信息
    @PostMapping("/message/dealerAttachArea/deleteAreaById")
    RestResultResponse deleteAreaById(@RequestParam("areaId") Long areaId);
    //修改区域信息
    @PostMapping("/message/dealerAttachArea/updateAreaById")
    RestResultResponse updateAreaById(@RequestParam("areaId") Long areaId,@RequestParam("areaName") String areaName);
}
